package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 请求方法的限定 method属性
 * @author stone
 * @date 2021/11/22 15:36
 */
@RequestMapping("method/limit")
@Controller
public class RequestMethodLimitController {

    @ResponseBody
    //@RequestMapping(value = "get",method = RequestMethod.GET)
    @GetMapping("get")
    public String methodGet() {
        return "Method GET";
    }

    @ResponseBody
    //@RequestMapping(value = "post",method = RequestMethod.POST)
    @PostMapping("post")
    public String methodPost() {
        return "Method POST";
    }

    @ResponseBody
    @RequestMapping(value = "double",method = {RequestMethod.GET,RequestMethod.POST})
    public String methodDouble() {
        return "Method Double";
    }
}
